#!name = 知乎去广告
#!desc = 去除各部广告，建议卸载知乎重新安装。
#!openUrl = 
#!author = RuCu6 blackmatrix7
#!homepage = https://gitlab.com/lodepuly/vpn_tool/-/tree/main/Tool/QuantumultX/Rewrite

#[rewrite_local]
# 首页 - 悬浮图标、顶部横幅、开屏广告、关注页推荐、推荐信息流、热榜信息流、热榜直播、回答底部卡片
^https:\/\/api\.zhihu\.com\/commercial_api\/(banners_v3\/app_topstory_banner$|launch_v2\?|real_time_launch_v2\?) url reject-dict
^https:\/\/api\.zhihu\.com\/content-distribution-core\/bubble\/common\/settings$ url reject-dict
^https:\/\/api\.zhihu\.com\/(moments\/lastread|drama\/hot-drama-list)$ url reject-dict

# 我的页面 - 项目列表、会员卡片、更多卡片
^https:\/\/api\.zhihu\.com\/me\/guides\?? url reject-dict
^https:\/\/api\.zhihu\.com\/unlimited\/go\/my_card$ url reject
^https:\/\/www\.zhihu\.com\/appview\/v2\/zhmore\? url reject

# 搜索页 - 关键词、猜你想搜
^https:\/\/api\.zhihu\.com\/feed\/render\/revisit\/current_reading$ url reject-dict
^https:\/\/api\.zhihu\.com\/search\/preset_words\?? url reject-dict
^https:\/\/www\.zhihu\.com\/api\/v4\/search\/related_queries\/(answer|article)\/\d+ url reject-dict
^https:\/\/api\.zhihu\.com\/root\/window$ url reject-dict

# 其他、服务器推送配置
^https:\/\/api\.zhihu\.com\/ab\/api\/v1\/products\/zhihu\/platforms\/ios\/config$ url reject
^https:\/\/api\.zhihu\.com\/ad-style-service\/request$ url reject-dict
^https:\/\/appcloud2\.zhihu\.com\/v3\/resource\?group_name=mp$ url reject-dict

# 网页版去广告 //www.zhihu.com、 zhuanlan.zhihu.com
^https:\/\/api\.zhihu\.com\/distribute\/rhea\/qa_ad_card\/h5\/recommendation\? url reject-dict
^https:\/\/www\.zhihu\.com\/api\/v4/(questions|anwsers)\/\d+/related-readings url reject
^https:\/\/www\.zhihu\.com\/api\/v4\/hot_recommendation url reject
^https:\/\/www\.zhihu\.com\/commercial_api\/banners_v3\/mobile_banner url reject
^https:\/\/zhuanlan\.zhihu\.com\/api\/articles\/\d+\/recommendation url reject


# 首页 - 悬浮图标、顶部横幅、开屏广告、关注页推荐、推荐信息流、热榜信息流、热榜直播、回答底部卡片
^https:\/\/api\.zhihu\.com\/commercial_api\/app_float_layer$ url script-response-body https://gitlab.com/lodepuly/vpn_tool/-/raw/master/Resource/Script/Zhihu/Zhihu_remove_ads.js

^https:\/\/api\.zhihu\.com\/(moments_v3|topstory\/recommend(_v2)?)\? url script-response-body https://gitlab.com/lodepuly/vpn_tool/-/raw/master/Resource/Script/Zhihu/Zhihu_remove_ads.js
^https:\/\/api\.zhihu\.com\/v2\/topstory\/hot-lists\/everyone-seeing\? url script-response-body https://gitlab.com/lodepuly/vpn_tool/-/raw/master/Resource/Script/Zhihu/Zhihu_remove_ads.js

# 搜索页 - 关键词、猜你想搜
^https:\/\/api\.zhihu\.com\/search\/recommend_query\/v2\? url response-body "recommend_queries":\{.+\} response-body "recommend_queries":{}

# 回答详情页、下一个回答
^https:\/\/api\.zhihu\.com\/next-(bff|data)\? url script-response-body https://gitlab.com/lodepuly/vpn_tool/-/raw/master/Resource/Script/Zhihu/Zhihu_remove_ads.js
^https:\/\/api\.zhihu\.com\/(v4\/)?questions\/\d+\/(feeds|answers)\? url script-response-body https://gitlab.com/lodepuly/vpn_tool/-/raw/master/Resource/Script/Zhihu/Zhihu_remove_ads.js
^https:\/\/www\.zhihu\.com\/api\/v4\/(answers|articles)\/\d+\/recommendations?\? url script-response-body https://gitlab.com/lodepuly/vpn_tool/-/raw/master/Resource/Script/Zhihu/Zhihu_remove_ads.js

# 其他、服务器推送配置
^https:\/\/appcloud2\.zhihu\.com\/v3\/config$ url script-response-body https://gitlab.com/lodepuly/vpn_tool/-/raw/master/Resource/Script/Zhihu/Zhihu_remove_ads.js
^https:\/\/m-cloud\.zhihu\.com\/api\/cloud\/config\/all\? url script-response-body https://gitlab.com/lodepuly/vpn_tool/-/raw/master/Resource/Script/Zhihu/Zhihu_remove_ads.js

#[mitm]
hostname = api.zhihu.com, appcloud2.zhihu.com, m-cloud.zhihu.com, www.zhihu.com, zhuanlan.zhihu.com